package com.sf.iisp.kafka.adapter;


/**
 * kafka通用生产端适配器
 */
public class KafkaProducerAdapter {
    protected IKafkaProducerPoolDelegate kafkaProducerPoolDelegate;
    protected boolean kafkaProducerSwitch = true;//true：开 false：关 默认打开

    public void sendString(String message) {
        if (this.kafkaProducerSwitch) {
            this.kafkaProducerPoolDelegate.sendString(message);
        }
    }

    public IKafkaProducerPoolDelegate getKafkaProducerPoolDelegate() {
        return kafkaProducerPoolDelegate;
    }

    public void setKafkaProducerPoolDelegate(
            IKafkaProducerPoolDelegate kafkaProducerPoolDelegate) {
        this.kafkaProducerPoolDelegate = kafkaProducerPoolDelegate;
    }

    public boolean isKafkaProducerSwitch() {
        return kafkaProducerSwitch;
    }

    public void setKafkaProducerSwitch(boolean kafkaProducerSwitch) {
        this.kafkaProducerSwitch = kafkaProducerSwitch;
    }

}
